#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Create by zhang
# Create on 2022/6/28 14:56
class MoneyType:
    def __init__(self, name: str, title: str, value: int):
        self.name: str = name
        self.title: str = title
        self.value: int = value


class MoneyUnitEnum:
    ONE = MoneyType(name="one", title="元", value=1000)
    THOUSAND = MoneyType(name="thousand", title="千", value=1000)
    TEN_THOUSAND = MoneyType(name="ten_thousand", title="万", value=10000)
    HUNDRED_THOUSAND = MoneyType(name="hundred_thousand", title="十万", value=100000)
    MILLION = MoneyType(name="million", title="百万", value=1000000)

    @classmethod
    def get_type(cls, name:str):
        return {
            cls.THOUSAND.name: cls.THOUSAND,
            cls.TEN_THOUSAND.name: cls.TEN_THOUSAND,
            cls.HUNDRED_THOUSAND.name: cls.HUNDRED_THOUSAND,
            cls.MILLION.name: cls.MILLION
        }.get(name, None)
